<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <!-- <div class="box" data-index='1' ></div> -->
    <script>
        let num = 10;
        // num++ 
        // console.log(num);
        // ++num;
        // console.log(num);

        // let sum = num++;
        // console.log(sum);  // 10  ++在后 先赋值给sum, num再自增1

        let cont = ++num;
        console.log(cont); //  11  ++在前  num先自增1 ，然后在赋值
    </script>
</body>

</html>